package com.admin.system.entity;

import java.time.LocalDateTime;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
* @author : alex
* @date : 2020/6/21
*/
public class SystemLog {

    /**
     *
     */
    @ExcelIgnore
    private Integer id;
    /**
     * 管理员ID
     */
    @ExcelProperty(index = 0, value = "用户ID")
    @ColumnWidth(10)
    private Integer userId;

    /**
     * 用户名
     */
    @ExcelProperty(index = 1, value = "用户名")
    @ColumnWidth(10)
    private String userName;

    /**
     * ip
     */
    @ExcelProperty(index = 2, value = "ip地址")
    @ColumnWidth(15)
    private String ip;

    /**
     * 客户端
     */
    @ExcelIgnore
    private String client;
    /**
     * 请求路径
     */
    @ExcelIgnore
    private String url;
    /**
     * 请求参数
     */
    @ExcelIgnore
    private String params;
    /**
     * 操作时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private LocalDateTime createTime;

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return this.id;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getUserId() {
        return this.userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getIp() {
        return this.ip;
    }

    public void setClient(String client) {
        this.client = client;
    }

    public String getClient() {
        return this.client;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return this.url;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getParams() {
        return this.params;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getCreateTime() {
        return this.createTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("SystemLog[");
        sb.append("id=").append(id);
        sb.append(",userId=").append(userId);
        sb.append(",ip=").append(ip);
        sb.append(",client=").append(client);
        sb.append(",url=").append(url);
        sb.append(",params=").append(params);
        sb.append(",createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}
